/*! \file conversion.h
	\author HiddenSeeker

	Defines a conversion node
*/
#include "../abstractnode.h"
#include "classtype.h"
#pragma once

class MethodSelectDelegate;
class ParentData;

/*! Declares a type conversion node
*/
class ConversionNode: public AbstractNode
{
 private:
	      ClassTypeNode * m_type;
		  AbstractNode * m_expr;
		  AbstractNode * m_moveexpr;
		  MethodSelectDelegate * m_delegate;
 public:
	    ConversionNode(const YYLTYPE & pos, ClassTypeNode * type, AbstractNode * exp) : AbstractNode(pos)
	    {
			m_type=type;
			m_expr=exp;
			m_moveexpr=NULL;
			m_delegate=NULL;
	    }
		/*! Checks common errors
		  */
		 virtual void checkCommonErrors(ParentData * data);
		 /*! Fills a constant table for method
		  */
		 virtual void fillConstant(ParentData * data);
		 /*! Produces a code for method
		  */
		 virtual void produceCode(ParentData * data);
		 /*! Returns unknown type
		 */
		 virtual std::string getType(ParentData * data);
		/*! Writes a node data to stream
		 */
	    void write(GraphStream * s);
		
		~ConversionNode();
};
